package com.bwie.auth.controller;

import com.bwie.auth.service.AuthService;
import com.bwie.common.domain.SysUser;
import com.bwie.common.domain.request.SysUserRequest;
import com.bwie.common.domain.response.JwtResponse;
import com.bwie.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: AuthController
 * @Description:
 * @Author: 平安
 * @Date: 2024/4/25 9:16:27
 */
@RestController
@RequestMapping("/user")
public class AuthController {

    @Autowired
    private AuthService authService;

    @PostMapping("/login")
    public Result<JwtResponse> login(@RequestBody SysUserRequest sysUserRequest){
        return authService.login(sysUserRequest);
    }

    @GetMapping("/info")
    public Result<SysUser> info(){
        return Result.success(authService.info());
    }

}
